﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;

namespace WikiGame.Utilities
{
    public static class StringGenerator
    {
        private static readonly int DEF_SIZE = 10;

        public static string GenerateRandomString()
        {
            return GenerateRandomString(DEF_SIZE);
        }

        public static string GenerateRandomString(int length)
        {
            StringBuilder builder = new StringBuilder();
            Random random = new Random();
            char ch;
            for (int i = 0; i < length; i++)
            {
                ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65)));
                builder.Append(ch);
            }
            return builder.ToString();
        }
    }
}